package com.zys.el.security.dao;

import com.zys.el.core.dao.ICrudDao;
import com.zys.el.security.po.Role;
import com.zys.el.security.po.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface UserDao extends ICrudDao<User> {

    /**
     * 删除用户角色关联
     *
     * @param id
     * @return
     */
    public int deleteRoleByUser(Long id);

    /**
     * 关联用户角色
     *
     * @param roleId
     * @param userId
     * @return
     */
    public int insertRoleAndUser(@Param("roleId") Long roleId, @Param("userId") Long userId);

    /**
     * 查询用户的角色
     *
     * @param id
     * @return
     */
    public List<Role> selectRoleByUser(Long id);

}
